<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- <link rel="stylesheet" href="./day.css"> -->
    <title>Document</title>
</head>

<body>
    <button onclick="beDay()">白天</button>
    <button onclick="beNight()">黑夜</button>
    <script>
        let link = document.createElement('link')
        function beDay() {
            link.rel="stylesheet"
            link.href = './dark.css'
            document.head.appendChild(link)
        }
        function beNight() {
            link.href = './day.css'
        }

    </script>
</body>

</html>